package com.oilsection.demo.controller;

import com.oilsection.demo.controller.req.ZrEventImportReq;
import com.oilsection.demo.controller.req.ZrEventPageQueryReq;
import com.oilsection.demo.controller.req.ZrEventUpdateReq;
import com.oilsection.demo.controller.res.JcEventRightPanelResponse;
import com.oilsection.demo.controller.res.ZrEventPageQueryResponse;
import com.oilsection.demo.po.JcEvent;
import com.oilsection.demo.service.JcEventService;
import com.oilsection.demo.service.ZrEventService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/jcEvent")
@RequiredArgsConstructor
@Slf4j
public class JcEventController {
    private final JcEventService jcEventService;

    @PostMapping("/list")
    @CrossOrigin
    public List<JcEventRightPanelResponse> list(@RequestBody JcEvent req) {
        log.info("list req: {}", req);
        return jcEventService.list(req);
    }

    @PostMapping("/listEvents")
    @CrossOrigin
    public List<JcEventRightPanelResponse> listEvents(@RequestBody JcEvent req) {
        log.info("listEvents req: {}", req);
        return jcEventService.listEvents(req);
    }
}
